﻿{include file="public/header"}
<title>问题修改</title>
</head>
<body>

<style>
    .form-label {
        width: 26% !important;
    }

    .row {
        margin-bottom: 3% !important;
    }

</style>
<article style="padding: 10px;">
    <form>

            <div class="ch-row ch-info-form">
                <div class="flex1">标题：</div>
                <div class="flex2">
                    <input type="text" name="detailed_title" class="form-control" value="{$data.detailed_title}">
                    <input type="hidden" name="detaileds_id" value="0">
                    <input type="hidden" name="detailed_id" value="{$data.detailed_id}">
                </div>
            </div>
            <div class="ch-row ch-info-form">
                <div class="flex1">标记代购主材：</div>
                <div class="flex2">
                    <input type="radio" name="agency"  value="1">是
                    <input type="radio" name="agency"  value="0">否

                </div>
            </div>

        <div class="ch-row">
            <div class="flex1">
                <button style="width: 100%;" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe632;</i>
                    提交
                </button>
            </div>
        </div>

    </form>
</article>

{include file="public/footer"}
<script>
    $('.radius').click(function () {
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        var src = "{:Url('index/detailed/ad')}?id=0";
        $.ajax({
            type: 'POST',
            url: src,
            dataType: 'json',
            data: $('form').serializeArray(),
            success: function (data) {
                var res = JSON.parse(data);
                if (res.code == 200) {
                    window.parent.location.reload(); //刷新父页面
                    parent.layer.close(index);  // 关闭layer

                } else {
                    layer.msg(res.msg, {icon: 5, time: 1000});
                }

            },
            error: function (data) {
                console.log(data.msg);
            },
        });


    });
</script>
</body>
</html>